package com.jun;
import java.sql.*;

public class TestJdbc01 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        String url="jdbc:mysql://localhost:3306/jdbcstudy?useUnicode=true&characterEncoding=utf-8&useSSL=false";
        String username = "root";
        String password = "123456";
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection(url, username, password);
        Statement statement = connection.createStatement();
        String sql = "delete from users where id=4;";
        int num = statement.executeUpdate(sql);
        if(num>0) System.out.println("AAAAAAAAAAAA");
//        while (rs.next()){
//            System.out.println("id="+rs.getObject("id"));
//            System.out.println("name="+rs.getObject("name"));
//            System.out.println("password="+rs.getObject("password"));
//            System.out.println("email="+rs.getObject("email"));
//            System.out.println("birthday="+rs.getObject("birthday"));
//        }
//        rs.close();
        statement.close();
        connection.close();
    }
}
